home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d11
/
ev678dev.arc
/
DUMPMODE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-07-03
|
9KB
|
306 lines
{-----------------------------------------------------------------------}
{ Program to get from the BIOS and any EV-678 mode TSR present a list }
{ of all of the modes supported for a particular monitor. It also }
{ reads the state of the board. It does this by calling the two }
{ Everex Extended BIOS functions below: }
{-----------------------------------------------------------------------}
{ bx = 00h: return emulation status }
{ - cl = monitor type }
{ - ch (b0) = 6845 emulation }
{ - (b1,3) = unused (0) }
{ - (b4) = VGA Protect enabled }
{ - (b5) = 44.9MHz present }
{ - (b6,7) = 256K/512K/1024K/2048K }
{ - dx = BCD board id (b15..b4: model, b3..b0: revision) }
{ - di = BCD BIOS version number }
{-----------------------------------------------------------------------}
{ bx = 05h: Get mode supported info for current }
{ Entry: cl = Maximum number of modes to get info for }
{ dl = monitor type to get mode info for }
{ es:di -> buffer of sufficient size }
{ ch = Mode type to get info for: }
{ = 00h to get all modes }
{ = 01h to get mono text modes }
{ = 02h to get color text modes }
{ = 03h to get 4 color (CGA) grfx modes }
{ = 04h to get 1 color (CGA) grfx modes }
{ = 05h to get 16 color grfx modes }
{ = 06h to get 256 color grfx modes }
{ - cl = Total number of modes fitting criteria }
{ - ch = Size of each record }
{ Info record format: }
{ (b) - Mode number (b7 set if it is an extended mode)}
{ (b) - Mode format (same definition as ch above) }
{ (b) - Info bits }
{ (b0) - paged mode }
{ (b1,2) Requires 256K/512K/1024K/2048K }
{ (b3) - Requires 44.9MHz }
{ (b4) - Interlaced mode }
{ (b5) - monochrome mode }
{ (b6.7) - reserved }
{ (b) - font height }
{ (b) - Columns on screen (text format) }
{ (b) - Rows on screen (text format) }
{ (w) - Number of scan lines }
{ (b) - Color info }
{ (b0.3) Bits per pixel }
{ (b4.7) reserved (0) }
{ bx = 05h: Get mode supported info for current }
{ Entry: cl = Maximum number of modes to get info for }
{ dl = monitor type to get mode info for }
{ es:di -> buffer of sufficient size }
{ ch = Mode type to get info for: }
{ = 00h to get all modes }
{ = 01h to get mono text modes }
{ = 02h to get color text modes }
{ = 03h to get 4 color (CGA) grfx modes }
{ = 04h to get 16 color grfx modes }
{ = 05h to get 256 color grfx modes }
{ - cl = Total number of modes fitting criteria }
{ - ch = Size of each record }
{ Info record format: }
{ (b) - Mode number (b7 set if it is an extended mode)}
{ (b) - Mode format (same definition as ch above) }
{ (b) - Info bits }
{ (b0) - paged mode }
{ (b1,2) Requires 256K/512K/1024K/2048K }
{ (b3) - Requires 44.9MHz }
{ (b4) - Interlaced mode }
{ (b5) - monochrome mode }
{ (b6.7) - reserved }
{ (b) - font height }
{ (b) - Columns on screen (text format) }
{ (b) - Rows on screen (text format) }
{ (w) - Number of scan lines }
{ (b) - Color info }
{ (b0.3) - Bits per color }
{ (b4.7) - reserved (0) }
{-----------------------------------------------------------------------}
uses
dos;
{-----------------------------------------------------------------------}
type
s64 = string[64];
Ev678ModeInfoType = record
mode : byte;
memorg : byte;
info : byte;
points : byte;
columns : byte;
rows : byte;
scanline: word;
color : byte;
end;
{-----------------------------------------------------------------------}
const
MonitorType : array [$00..$07] of s64 =
('Monochrome',
'CGA',
'EGA',
'TTL multifrequency',
'IBM PS/2 fixed frequency',
'IBM 8514 fixed frequency',
'Analog multifrequency',
'Analog multifrequency');
EmulationType : array [$00..$01] of s64 =
('Standard VGA',
'6845 emulation');
MemorySizeType : array [$00..$03] of s64 =
(' 256K',
' 512K',
'1024K',
'2048K');
ProtectType : array [$00..$01] of s64 =
('VGA registers unprotected',
'VGA registers protected');
CrystalPresentType : array [$00..$01] of s64 =
('44.9MHz crystal not present',
'44.9MHz crystal present');
MemoryOrgType : array [$00..$08] of s64 =
('Invalid ',
'Mono Txt ',
'Colr Txt ',
'4 Grfx ',
'2 Grfx ',
'Planar ',
'256 Grfx ',
'Unknown ',
'Unknown ');
CrystalNeededType : array [$00..$01] of s64 =
(' ',
'44.9MHz');
InterlacedType : array [$00..$01] of s64 =
(' ',
'intrlcd');
PagedType : array [$00..$01] of s64 =
(' ',
'paged');
ColorMonoType : array [$00..$01] of s64 =
('C',
'M');
{-----------------------------------------------------------------------}
var
reg : Registers;
i : byte;
modeptr : ^Ev678ModeInfoType;
indxptr : ^Ev678ModeInfoType;
modesize: byte;
modenum : byte;
modeind : byte;
{-----------------------------------------------------------------------}
{-----------------------------------------------------------------------}
function decval(decnum : real) : s64;
const table : array [0..15] of char = ('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
begin
decval := table[trunc(decnum)];
end;
function dectohex(decnum : real) : s64;
begin
if decnum >= 16.0 then begin
dectohex := dectohex(decnum/16) + decval(decnum - 16.0*trunc(decnum/16.0));
end else
dectohex := decval(decnum);
end;
function hex(decnum : real) : s64;
var i : byte;
tmp : s64;
begin
tmp := dectohex(decnum);
for i := 1 to 2-Length(tmp) do
tmp := '0'+tmp;
tmp := tmp+'h';
hex := tmp;
end;
{-----------------------------------------------------------------------}
{-----------------------------------------------------------------------}
begin
reg.AX := $7000;
reg.BX := $0000; { Get card info }
Intr($10,reg);
if (reg.AL<>$70) then begin
writeln('Everex Extended BIOS calls not supported.');
halt(1);
end;
if ((reg.DX and $FFF0)=$6730) then begin
writeln('Everex EVGA (EV673) does not support mode info function.');
halt(1);
end;
write('Adapter : EV-');
for i := 0 to 2 do begin
write(chr(((reg.DX shr $0C) and $0F) + ord ('0')));
reg.DX := reg.DX shl $04;
end;
writeln;
write('BIOS Version: v');
for i := 0 to 2 do begin
reg.DI := reg.DI shl $04;
write(chr(((reg.DI shr $0C) and $0F) + ord ('0')));
if (i=0) then
write('.');
end;
writeln;
writeln('Monitor Type: ',MonitorType[reg.cl]);
writeln('Emulation : ',EmulationType[reg.ch and $01]);
writeln('Memory Size : ',MemorySizeType[(reg.ch shr 6) and $03]);
writeln('Protection : ',ProtectType[(reg.ch shr 4) and $01]);
writeln('44.9MHz : ',CrystalPresentType[(reg.ch shr 5) and $01]);
reg.AX := $7000;
reg.BX := $0005; { Get mode info }
reg.DL := reg.CL; { Get mode info for current monitor }
reg.CL := $00; { Get 00 modes on the first call }
reg.CH := $00; { Get all modes }
Intr($10,reg);
modenum := reg.CL; { Get total number of modes }
modesize:= reg.CH; { Get size of each record }
GetMem(modeptr,modenum*modesize);
reg.AX := $7000;
reg.CH := $00; { Get all modes }
reg.ES := Seg(modeptr^);
reg.DI := Ofs(modePtr^);
Intr($10,reg); { Get all mode info }
for modeind := 0 to modenum-1 do begin
indxptr := Ptr(Seg(modeptr^),Ofs(modeptr^)+modeind*modesize);
with indxptr^ do begin
if(mode>=$80) then
write('x')
else
write(' ');
write(hex(mode and $7F),' ');
write(MemoryOrgType[memorg],' ');
write(columns:3,'x');
write(rows:2,' ');
if ((points and $80) = $80) then
write('9')
else
write('8');
write('x',(points and $3F):2,' ');
if ((points and $80) = $80) then
write(9*columns:4)
else
write(8*columns:4);
write('x',scanline:3);
write('x',(color and $0F):1,' ');
write(ColorMonoType[(info shr 5) and $01],' ');
write(MemorySizeType[(info shr 1) and $03],' ');
write(CrystalNeededType[(info shr 3) and $01],' ');
write(PagedType[info and $01],' ');
write(InterlacedType[(info shr 4) and $01],' ');
end; {with}
writeln;
end; {for}
end.
{-----------------------------------------------------------------------}
{-----------------------------------------------------------------------}